

//引入mongoose数据库
const mongoose = require("mongoose");
//2.创建当前数据库的某个集合的约束对象 //mongoose.Schema()
const adminSchema = new mongoose.Schema({
    adminName: {
        type: String,
        unique: true,
        required: true
    },
    passWord: {
        type: String,
        required: true
    },
    regTime: {
        type: String,
        required: true
    },
    loginTime: {
        type: String,
        required: true,
        default:"----"
    },
    status:{
        type: String,
        required: true,
        default:"0"
    }
});

//3.根据某个约束对象,去创建某个集合
const adminModel = mongoose.model("adminList", adminSchema); //集合的名字 约束对象
//暴露
module.exports = adminModel;